<template>
  <div class="not-found">
    <div class="not-found-container">
      <div class="not-found-content">
        <!-- 404 数字动画 -->
        <div class="error-number wow fadeInUp">
          <span class="four">4</span>
          <span class="zero">0</span>
          <span class="four">4</span>
        </div>

        <!-- 错误信息 -->
        <div class="error-info wow fadeInUp" data-wow-delay="0.2s">
          <h1>页面未找到</h1>
          <p class="error-message">
            抱歉，您访问的页面不存在或已被移动。
          </p>
          <p class="error-suggestion">
            请检查网址是否正确，或返回首页继续浏览。
          </p>
        </div>

        <!-- 操作按钮 -->
        <div class="error-actions wow fadeInUp" data-wow-delay="0.4s">
          <router-link to="/home" class="btn btn-primary">
            <i class="glyphicon glyphicon-home"></i>
            返回首页
          </router-link>
          <button @click="goBack" class="btn btn-secondary">
            <i class="glyphicon glyphicon-arrow-left"></i>
            返回上页
          </button>
        </div>

        <!-- 快速导航 -->
        <div class="quick-links wow fadeInUp" data-wow-delay="0.6s">
          <h3>您可能在寻找：</h3>
          <div class="quick-links-grid">
            <router-link to="/software" class="quick-link">
              <i class="glyphicon glyphicon-th-large"></i>
              <span>公司产品</span>
            </router-link>
            <router-link to="/service" class="quick-link">
              <i class="glyphicon glyphicon-cog"></i>
              <span>相关服务</span>
            </router-link>
            <router-link to="/companyintroduction" class="quick-link">
              <i class="glyphicon glyphicon-info-sign"></i>
              <span>公司介绍</span>
            </router-link>
            <router-link to="/contactus" class="quick-link">
              <i class="glyphicon glyphicon-envelope"></i>
              <span>联系我们</span>
            </router-link>
          </div>
        </div>
      </div>

      <!-- 装饰性元素 -->
      <div class="floating-elements">
        <div class="floating-circle circle-1"></div>
        <div class="floating-circle circle-2"></div>
        <div class="floating-circle circle-3"></div>
      </div>
    </div>
  </div>
</template>

<script setup name="NotFound">
import WOW from 'wow.js'
import { onMounted } from 'vue'

function goBack() {
  if (window.history.length > 1) {
    window.history.back()
  } else {
    window.location.href = '/home'
  }
}

onMounted(() => {
  const wow = new WOW({
    boxClass: 'wow',
    animateClass: 'animated',
    offset: 0,
    mobile: true,
    live: true
  })
  wow.init()
})
</script>

<style scoped>
/* 404页面样式 - 苹果风格 */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  position: relative;
  overflow: hidden;
}

.not-found-container {
  max-width: 800px;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.not-found-content {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 60px 40px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 404数字动画 */
.error-number {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.error-number span {
  font-size: clamp(80px, 15vw, 120px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.four {
  color: #0071e3;
  animation: bounce 2s ease-in-out infinite;
}

.zero {
  color: #ff3b30;
  animation: pulse 2s ease-in-out infinite;
}

.four:last-child {
  color: #34c759;
  animation: bounce 2s ease-in-out infinite 0.2s;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* 错误信息 */
.error-info h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
}

.error-message {
  font-size: 18px;
  color: #515154;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.error-suggestion {
  font-size: 16px;
  color: #86868b;
  margin: 0 0 40px 0;
  line-height: 1.5;
}

/* 操作按钮 */
.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.btn {
  padding: 16px 32px;
  border-radius: 980px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #0071e3, #005bb5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0077ed, #0066cc);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.4);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background: #ffffff;
  color: #0071e3;
  border: 2px solid rgba(0, 113, 227, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: rgba(0, 113, 227, 0.05);
  border-color: #0071e3;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.2);
}

/* 快速导航 */
.quick-links h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 24px 0;
  letter-spacing: -0.01em;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(0, 113, 227, 0.05);
  border-radius: 16px;
  text-decoration: none;
  color: #0071e3;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(0, 113, 227, 0.1);
}

.quick-link:hover {
  background: rgba(0, 113, 227, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.2);
  color: #0077ed;
  text-decoration: none;
  border-color: rgba(0, 113, 227, 0.2);
}

.quick-link i {
  font-size: 24px;
}

.quick-link span {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* 装饰性浮动元素 */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.floating-circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.1), rgba(0, 113, 227, 0.05));
  animation: float 6s ease-in-out infinite;
}

.circle-1 {
  width: 100px;
  height: 100px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 60px;
  height: 60px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.circle-3 {
  width: 80px;
  height: 80px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.8;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .not-found-container {
    padding: 20px 16px;
  }

  .not-found-content {
    padding: 40px 24px;
    border-radius: 20px;
  }

  .error-number {
    gap: 10px;
    margin-bottom: 30px;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .quick-link {
    padding: 16px 12px;
  }

  .quick-link i {
    font-size: 20px;
  }

  .quick-link span {
    font-size: 13px;
  }

  .floating-circle {
    display: none;
  }
}

@media (max-width: 480px) {
  .error-number span {
    font-size: 60px;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
    max-width: 200px;
  }
}
</style>